package com.oauth.application.server.utils;

import java.util.ArrayList;
import java.util.List;

import com.oauth.application.client.beans.ApplicationClientBean;
import com.oauth.service.application.registry.beans.ApplicationInfoBean;

public class ApplicationUtil {

	public static List<ApplicationClientBean> convertToClientBeans(
			List<ApplicationInfoBean> pApplicationInfoList) {
		List<ApplicationClientBean> apps = new ArrayList<ApplicationClientBean>();

		if (pApplicationInfoList != null) {
			for (ApplicationInfoBean serviceBean : pApplicationInfoList) {
				ApplicationClientBean application = new ApplicationClientBean(
						serviceBean.getName(), serviceBean.getKey(), serviceBean.getAddUrl(),
						serviceBean.getIconUrl(), serviceBean.getImageUrl());
				apps.add(application);
			}
		}
		return apps;
	}
}
